<template>
	<a-tooltip>
	    <template slot="title">
	      点击下载模板
	    </template>
	    <a :href="downTemplateUrl" target="_blank" :download="downTemplateName"
	     class="ml5" @click="downTemplate">下载模板</a>
	  </a-tooltip>
	
</template>

<script>
	export default{
		name: 'downloadTem',
		props:{
			type:{
				type:String,
				default:""
			}
		},
		data(){
			return{
				downTemplateUrl:'',
				downTemplateName:''
			}
		},
		created() {
			switch (this.type) {
				case "device_instance":
					this.downTemplateUrl = 'template/设备实例.xlsx';
					break;
				default:
					break;
			}
		},
		methods: {
			//下载模板
			downTemplate() {
				this.downTemplateName = this.downTemplateUrl.substring(this.downTemplateUrl.lastIndexOf('/') + 1);
			
			},
		},
	}
</script>

<style>
</style>
